<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('pay_mch', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('支付商户配置');

            $table->increments('id');
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);
            $table->integer('mch_type')->comment('类型 1微信H5 2支付宝 3易宝...')->unsigned()->default(0);
            $table->string('name', 50)->comment('名称')->default('');
            $table->string('desc', 100)->comment('描述')->default('');
            $table->string('appid', 64)->comment('appid')->default('');
            $table->string('secret', 64)->comment('secret')->default('');
            $table->string('mch_id', 64)->comment('mch_id')->default('');
            $table->string('mch_key', 64)->comment('mch_key')->default('');

            $table->unique('name');
            $table->index('appid');
            $table->index('mch_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('pay_mch');
    }
};
